<?php

namespace Zwwl2016\System;

use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;
use zwwl2016\cloudrunner\SimpleLaravelCloudExecutor;

class CloudRunnerServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(SimpleLaravelCloudExecutor::class, function ($app) {
            return SimpleLaravelCloudExecutor::Instance();
        });
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        $loader = AliasLoader::getInstance();
        $loader->alias("CloudRunner", SimpleLaravelCloudExecutor::class);
    }
}
